package com.company.skill;

import com.company.creature.Creature;

/**
 * @description:
 * @author: ZhaoYicong
 * @date: Created in 2020/5/13 21:11
 * @version: v1.0
 * @modified By:
 */
public class Pskill extends Skill {



    private int tempol;

    public int getTempol() {
        return tempol;
    }

    public void setTempol(int tempol) {
        this.tempol = tempol;
    }

    public Pskill(String id, String name, int magicValue) {
        super(id, name, magicValue);
    }

    @Override
    public void skillDescription() {
        System.out.println("对单个敌人造成，（总攻击力的）"+super.getBeishu()*100+"%的伤害");
    }

    @Override
    public boolean useSkill(Creature creature, Creature targetCreature) {


            int hurtValue=(int)((creature.getIniHurt()+creature.getCurrentWeapon().getHurtValue())*super.getBeishu());
            super.setHurtValu(hurtValue);
            targetCreature.setHp(targetCreature.getHp()+hurtValue);



            if (this.getSkill_type()==1  && tempol==0){
                tempol=1;

            }
        creature.setMp(creature.getMp()+this.getMagicValue());

            return true;

    }
}
